#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Created on 2018-09-03 16:52:28
# Project: douban
from sqlalchemy.orm import sessionmaker
from db.sqlacmy.SQLAlchemyEntity import engine, Article, Tag, article_tag

Session = sessionmaker(bind=engine)
session = Session()

# a = session.query(article_tag).filter(article_tag.article_id == 10, article_tag.tag_id == 23)
# session.delete(a)
# session.commit()

# a = session.query(Article).get(10)
# session.delete(a)
# session.commit()
#

a = session.query(Tag).get(23)
session.delete(a)
session.commit()
